import axios from "axios";

const instance = axios.create({
  // @ts-ignore
  baseURL: import.meta.env.VITE_API_BASE_URL, // .env配置
  timeout: 10000,
});

// 可添加请求/响应拦截器
instance.interceptors.request.use((config) => {
  // 可在此加token等
  return config;
});

instance.interceptors.response.use(
  (response) => response.data,
  (error) => Promise.reject(error)
);

export default instance;
